Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make GoogleAI Chat Generator compatible with new ChatMessage; small fixes to Cohere tests #1253

Merged
merged 5 commits into from
Dec 19, 2024

Conversation

anakin87
Copy link
Member

@anakin87 anakin87 commented Dec 18, 2024

Related Issues

Proposed Changes:

  • fixes to ensure the Google AI Chat Generator is compatible with both old and new ChatMessage
  • small fixes in Cohere tests (no need to release a new version for them)

How did you test it?

CI; local tests with Haystack main branch

Notes for the reviewer

These changes are temporary. I hope to get rid of them soon, once we reimplement this ChatGenerator to add proper tool support.

Checklist

@anakin87 anakin87 changed the title fix: make GoogleAI Chat Generator compatible with new ChatMessage fix: make GoogleAI Chat Generator compatible with new ChatMessage; small fixes to Cohere tests Dec 18, 2024
@@ -266,10 +271,21 @@ def _message_to_content(self, message: ChatMessage) -> Content:
part.function_response.response = message.text
elif message.is_from(ChatRole.USER):
part = self._convert_part(message.text)
elif "TOOL" in ChatRole._member_names_ and message.is_from(ChatRole.TOOL):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Even if I don't particularly like this check) this is done to check if the message has the tool role - only present in Haystack main (to be released in 2.9.0)

@anakin87 anakin87 marked this pull request as ready for review December 18, 2024 15:10
@anakin87 anakin87 requested a review from a team as a code owner December 18, 2024 15:10
@anakin87 anakin87 requested review from Amnah199 and removed request for a team December 18, 2024 15:10
Copy link
Contributor

@davidsbatista davidsbatista left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@anakin87 anakin87 merged commit 58cb135 into main Dec 19, 2024
16 checks passed
@anakin87 anakin87 deleted the fix-googleai-new-chatmessage branch December 19, 2024 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants